package com.Cychat.auth.service.Impl;

import com.Cychat.auth.entity.VO.UserInfoVO;
import com.Cychat.auth.mapper.UserMapper;
import com.Cychat.auth.service.UserInfoService;
import com.Cychat.auth.service.UserService;
import com.Cychat.commons.entity.ResultMessage;
import com.Cychat.commons.entity.pojo.User;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Auther: 刘博文
 * Date: 2025/11/6:11:26
 * Description:
 */
@Service
public class UserInfoServiceImpl extends ServiceImpl<UserMapper, User> implements UserInfoService {
    @Autowired
    private UserService userService;
    @Override
    public ResultMessage<UserInfoVO> getUserInfo(Long userId){
        User byId = userService.findById(userId);
        UserInfoVO userInfoVO = new UserInfoVO();
        BeanUtils.copyProperties(byId, userInfoVO);
        return ResultMessage.success(userInfoVO);
    }
}
